<div id="maincontent">

<%= render :partial => "shared_common_files/data_area_help_bar" %>

<!--h2>Group list</h2 -->
<h2>Group</h2>
<div >
      <%= start_form_tag ({:action => 'list'},{:class => 'appform'}) %>
<!-- OpenApp Built Search Panel starts -->
 <%=renderSearchPanel({"controller"=>"group", "action"=>"list"}, [{"label"=>"Group name ", "name"=>"name"},
                                                                 ])%>
<!-- OpenApp Built Search Panel ends-->

<%= end_form_tag %>
 	 </div>

<h5>List of groups in company</h5>	
  
    <% for name in [:notice, :warning, :message] %>
    <% if flash[name] %>
      <%= "<div class='message-fatal'> #{flash[name]} </div>" %>
    <% end %>
  <% end %>
<% for name in [:simplemsg] %>
    <% if flash[name] %>
      <%= "<div class='message-justmsg'> #{flash[name]} </div>" %>
    <% end %>
  <% end %>

<div class="list">
	<table>
		<tr>
			<td class="pagination" colspan="5"> 
			<!-- = pagination_links @org_pages  -->
			</td>
		</tr>
  
  <% for column in Group.content_columns %>
    <th><%= column.human_name %></th>
  <% end %>		
  <th>Action</th>
  
	<% count=1%>	  
	 <% rowtype="odd"%>
	<% for entry in @groups %>
  
	  <%if(isodd(count))%>
	     <% rowtype="odd"%>
	  <%else%>
	    <% rowtype="even"%>
	  <%end%>     
	  <tr class="<%=rowtype%>">
	  <% for column in Group.content_columns %>
	     <td> <%=entry.send(column.name) %> </td>
	  <% end %>

        <td>
        <!-- <%= link_if_authorized 'S', {:action => 'show', :id => entry}%> -->
        <%= link_if_authorized image_tag('/themes/odotclassic/images/edit.png', :title => 'Edit'), {:action => 'edit', :id => entry}%>
        <!-- <%= link_to "D", {:action => "destroy", :id => entry}, {:confirm => "Are you sure?"} %>  -->
       
        </td>

  </tr>
  <% count = count + 1 %>
<% end %>

	</table>
</div>

<br/><br/>

<div class="list">

    <%= start_form_tag({:action => 'new'}, {:method=>'get'}) %>
    
	<table>
	     <th>Action</th>
         <tr class="even">
            <td>
                
				<%= link_if_authorized image_tag('/themes/odotclassic/images/btn_cancel.gif', :alt => 'Cancel'), {:controller => "/controlpanel" ,:action => 'list'}  %>
            </td>
         </tr>        
	</table>
    <input type="hidden" name="cid" value="<%=current_user.organization_id%>"/>
    <%= end_form_tag %>
	<br/>
</div>


</div>


